package br.pucrio.inf.tamdera.prolog.qbeans;

import br.pucrio.inf.tamdera.ConceptDeclaration;
import br.pucrio.inf.tamdera.Constants;
import br.pucrio.inf.tamdera.DependencyRuleDeclaration;

public class PrologAntiErosionQueryBean  extends PrologQueryBean 
{

	public PrologAntiErosionQueryBean(String query, DependencyRuleDeclaration rule) {
		super(query);
		this.rule = rule;
	}
	private DependencyRuleDeclaration rule;

	public String getDeclString() {
		
		ConceptDeclaration source = rule.getSource();
		String concepSourcetName = source.getName();

		ConceptDeclaration target = rule.getTarget();
		String conceptTargetName = target.getName();

		String result = concepSourcetName + " " + rule.getType() + "-" + rule.getRelation() + " " + conceptTargetName; 

		if (rule.getType().equals(Constants.DEPENDENCY_TYPE_CAN))
		{
			result = "only " + result;
		}


		return result;
	}

	public DependencyRuleDeclaration getRule() {
		return rule;
	}
	public void setRule(DependencyRuleDeclaration rule) {
		this.rule = rule;
	}



}
